import request from '@/utils/request'
import {
  makeQueryParamsSafe
} from '@/utils/kris_utils'

export function agree(params) { // 获取本公司所有协议 传agree_id获取单个协议
  return request({
    url: `/v1/agree`,
    method: 'get',
    params
  })
}
export function setUpAgree(data) { // 创建协议
  return request({
    url: `/v1/agree`,
    method: 'post',
    data
  })
}
export function modifyAgree(params) { // 修改协议
  return request({
    url: `/v1/agree`,
    method: 'put',
    params
  })
}
export function deleteAgree(params) { // 删除协议
  return request({
    url: `/v1/agree`,
    method: 'delete',
    params
  })
}

export function agreeProtocol(company_id) { // 获取本公司所有协议 传agree_id获取单个协议
  return request({
    url: `/v1/agree`,
    method: 'get',
    headers: {
      'company-id': company_id
    }
  })
}

// word识别
export const wordRecognition = (data) => {
  return request({
    url: `/v1/agree/word`,
    method: 'POST',
    data
  })
}

// 获取尚未签名但替换占位符word
export const getSynthesizedWordsNoSign = (company_id, params) => {
  return request({
    url: '/v2/agree/interview',
    // url: '/v1/agree/interview',
    method: 'GET',
    params,
    headers: {
      'company-id': company_id
    }
  })
}

// 合成未签名的替换过后的word
export const refreshWord = (company_id, data) => {
  return request({
    url: '/v2/agree/interview',
    // url: '/v1/agree/interview',
    method: 'post',
    data,
    headers: {
      'company-id': company_id
    }
  })
}

